/* 首页全局样式 */
.home-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 页首样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.logo {
    height: 50px;
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-item {
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.nav-item:hover {
    color: #007bff;
}

/* 搜索框样式 */
.search-container {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.search-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-button {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* 轮播图样式 */
.carousel {
    margin: 20px 0;
    position: relative;
    height: 400px;
    overflow: hidden;
}

.carousel-item {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.carousel-item.active {
    opacity: 1;
}

/* 课程类别列表 */
.category-list {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.category-item {
    padding: 10px 20px;
    background: #f8f9fa;
    border-radius: 20px;
    cursor: pointer;
}

.category-item:hover {
    background: #e9ecef;
}

/* 课程列表样式 */
.course-section {
    margin: 40px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.course-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.course-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.course-info {
    padding: 15px;
}

.course-title {
    font-size: 18px;
    margin-bottom: 10px;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    color: #666;
    font-size: 14px;
}

/* 排序控件样式 */
.sort-controls {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

.sort-button {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

.sort-button.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* 页脚样式 */
.footer {
    margin-top: 50px;
    padding: 30px 0;
    background: #f8f9fa;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.footer-section h3 {
    margin-bottom: 15px;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #666;
    text-decoration: none;
}

.footer-links a:hover {
    color: #007bff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .course-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .nav-menu {
        display: none;
    }

    .course-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}
